package ch01.strategy;

/**
 * Created by zc on 2016/11/20.
 */
public class StrategyFacde {

    public void doSomething(String str){
        StrategyMan strategyMan = null;
        if(str.equalsIgnoreCase("Strategy1")) {
            strategyMan = StrategyMan.Strategy1;
        } else if(str.equalsIgnoreCase("Strategy2")) {
            strategyMan = StrategyMan.Strategy2;
        }

        IStrategy strategy = StrategyFactory.getStrategy(strategyMan);
        Context context = new Context(strategy);
        context.doSomething();
    }
}
